﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace FacialClub.Models.Entities
{
    [Bind(Include = "RefereeName,RefereeEmail,Message,Token,IsTokenUsed,CreatedOn")]
    [MetadataType(typeof (ReferFriendMetaData))]
    public partial class ReferFriend
    {
        /// <summary>
        /// ReferFriendMetaData
        /// </summary>
        [Bind(Exclude = "ReferFriendId")]
        public class ReferFriendMetaData
        {
            /// <summary>
            /// ReferFriendID
            /// </summary>
            [ScaffoldColumn(false)]
            public object ReferFriendId { get; set; }

            /// <summary>
            /// Referee Name
            /// </summary>
            [Required(ErrorMessage = "Referee Name Required!")]
            [StringLength(50, ErrorMessage = "Must be under 50 characters!")]
            public string RefereeName { get; set; }

            /// <summary>
            /// Referee Email
            /// </summary>
            [Required(ErrorMessage = "Email Required!")]
            [RegularExpression(
                "^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\\-+)|([A-Za-z0-9]+\\.+)|([A-Za-z0-9]+\\++))*[A-Za-z0-9]+@((\\w+\\-+)|(\\w+\\.))*\\w{1,63}\\.[a-zA-Z]{2,6}$"
                , ErrorMessage = "Not a valid email!")]
            public string RefereeEmail { get; set; }

            /// <summary>
            /// Friend Email
            /// </summary>
            [Required(ErrorMessage = "Friend Email is required!")]
            [DisplayName("Friend Email")]
            public string FriendEmail { get; set; }

            /// <summary>
            /// Message to be Send
            /// </summary>
            [Required(ErrorMessage = "Message is required!")]
            [DisplayName("Message")]
            public string Message { get; set; }

            /// <summary>
            /// Token
            /// </summary>
            public string Token { get; set; }

            /// <summary>
            /// IsTokenUsed
            /// </summary>
            public bool IsTokenUsed { get; set; }

            /// <summary>
            /// CreatedOn
            /// </summary>
            public DateTime CreatedOn { get; set; }
        }
    }
}